applications of residue theorem